package com.future.lock.common.http;

import com.future.lock.common.Constants;

import retrofit2.Call;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.POST;

/**
 * Created by jniu on 2017/11/27.
 */

public interface HttpApi {

    @POST(Constants.PATH_LOGIN)
    @FormUrlEncoded
    Call<String> login(@Field("phone") String phone,
            @Field("vcode") String code,
            @Field("clientid") String clientId,
            @Field("wx_openid") String wx_openid,
            @Field("wx_headimgurl") String wx_headimgurl,
            @Field("wx_nickname") String wx_nickname,
            @Field("os") String os);//登录

    @POST(Constants.PATH_WECHAT_LOGIN)
    @FormUrlEncoded
    Call<String> wechatLogin(@Field("wx_openid") String wxToken, @Field("clientid") String clientId, @Field("os") String os);//微信登录

    @POST(Constants.PATH_GET_CODE)
    @FormUrlEncoded
    Call<String> getCode(@Field("phone") String phone);//获取验证码

    @POST(Constants.PATH_UPDATE_USERINFO)
    @FormUrlEncoded
    Call<String> updateUserInfo(@Field("user_token") String user_token);//获取用户信息

    @POST(Constants.PATH_GET_COLLECT_LIST)
    @FormUrlEncoded
    Call<String> getCollectList(@Field("user_token") String user_token);//获取我的收藏列表

    @POST(Constants.PATH_GET_ORDER_NUM)
    @FormUrlEncoded
    Call<String> getOrderNum(@Field("user_token") String user_token);//获取各种订单数量

    @POST(Constants.PATH_GET_INFO_LIST)
    @FormUrlEncoded
    Call<String> getInfoList(@Field("page") int page);//获取资讯列表

    @POST(Constants.PATH_GET_SERVICE_PHONE)
    Call<String> getCustomServicePhone();//获取客服电话

    @POST(Constants.PATH_SET_USERINFO)
    @FormUrlEncoded
    Call<String> setUserInfo(@Field("user_token") String user_token, @Field("nickname") String nickname, @Field("face") String face);//设置头像昵称

    @POST(Constants.PATH_ADD_GATEWAY)
    @FormUrlEncoded
    Call<String> addGateway(@Field("user_token") String user_token, @Field("mac_address") String mac);//添加网关

    @POST(Constants.PATH_GET_GATEWAY_LIST)
    @FormUrlEncoded
    Call<String> getGatewayList(@Field("user_token") String user_token);//网关列表

    @POST(Constants.PATH_GET_LOCK_LIST)
    @FormUrlEncoded
    Call<String> getLockList(@Field("user_token") String user_token);//智能锁列表

    @POST(Constants.PATH_GET_LOCK_NOTES_LIST)
    @FormUrlEncoded
    Call<String> getLockNotesList(@Field("user_token") String user_token, @Field("lock_id") String lock_id);//智能锁列表

    @POST(Constants.PATH_CLEAR_LOCK_NOTES_LIST)
    @FormUrlEncoded
    Call<String> clearLockNotes(@Field("user_token") String user_token, @Field("lock_id") String lock_id);

    @POST(Constants.PATH_ADD_GATEWAY_FAIL)
    Call<String> addGatewayFail();

    @POST(Constants.PATH_ADD_LOCK)
    @FormUrlEncoded
    Call<String> addLock(@Field("user_token") String user_token, @Field("gateway_id") String gateway_id);

    @POST(Constants.PATH_DEL_GATEWAY)
    @FormUrlEncoded
    Call<String> delGateway(@Field("user_token") String user_token, @Field("gateway_id") String gateway_id);

    @POST(Constants.PATH_DEL_LOCK)
    @FormUrlEncoded
    Call<String> delLock(@Field("user_token") String user_token, @Field("lock_id") String lock_id);

    @POST(Constants.PATH_GET_LOCK_USER)
    @FormUrlEncoded
    Call<String> getLockUsers(@Field("user_token")String user_token,@Field("lock_id")String lock_id);

    @POST(Constants.PATH_SET_LOCK_USER_REMARK)
    @FormUrlEncoded
    Call<String> setLockUserRemark(@Field("user_token")String user_token
            ,@Field("un_user_id")String un_user_id
            ,@Field("remark")String remark);

    @POST(Constants.PATH_UPDATE_LOCK_NAME)
    @FormUrlEncoded
    Call<String> updateLockName(@Field("user_token") String user_token, @Field("lock_id") String lock_id, @Field("lock_name") String lock_name);

    @POST(Constants.PATH_OPEN_LOCK)
    @FormUrlEncoded
    Call<String> openLock(@Field("user_token")String user_token,
                          @Field("lock_id")String lock_id,
                          @Field("pwd")String pwd);


    @POST(Constants.PATH_GET_ORDER_LIST)
    @FormUrlEncoded
    Call<String> getOrderList(@Field("user_token") String user_token, @Field("status") int status);//获取用户订单列表

    @POST(Constants.PATH_GET_ORDER_LIST)
    @FormUrlEncoded
    Call<String> getAllOrderList(@Field("user_token") String user_token);//获取所有用户订单列表

    @POST(Constants.PATH_GET_ORDER_DETAIL)
    @FormUrlEncoded
    Call<String> getOrderInfo(@Field("user_token") String user_token, @Field("order_id") String orderId);//获取所有用户订单列表

    @POST(Constants.PATH_GET_PAY_INFO)
    @FormUrlEncoded
    Call<String> getPayInfo(@Field("user_token") String user_token, @Field("order_id") String orderId);//获取订单的支付信息

    @POST(Constants.PATH_SET_ORDER_STATUS)
    @FormUrlEncoded
    Call<String> setOrderStatus(@Field("user_token") String user_token, @Field("order_id") String orderId, @Field("status") int status);//修改订单状态

    @POST(Constants.PATH_GET_GOODS_DETAIL)
    @FormUrlEncoded
    Call<String> getGoodsInfo(@Field("goods_id") String goods_id);//获取商品详情

    @GET(Constants.PATH_GET_SHARE_BUNUS)
    Call<String> getShareBunusInfo();//获取分享立减金额

    @GET(Constants.PATH_GET_REFUND_INFO)
    Call<String> getRefundInfo();//获取退款说明

    @POST(Constants.PATH_GET_ADDRESS)
    @FormUrlEncoded
    Call<String> getAddress(@Field("user_token") String user_token);//获取用户上次填写的收货地址

    @GET(Constants.PATH_GET_SHARE_INFO)
    Call<String> getShareInfo();//获取分享信息

    @GET(Constants.PATH_GET_AREA)
    Call<String> getArea();//获取城市等

    @POST(Constants.PATH_GET_INSTALL_FEE)
    @FormUrlEncoded
    Call<String> getInstallFee(@Field("area_id") String area_id);//获取该区域安装费

    @GET(Constants.PATH_GET_ADDED_FEE)
    Call<String> getAddedFee();//获取增值服务费

    @GET(Constants.PATH_GET_INSTALL_AREA_DESC)
    Call<String> getInstallAreaDesc();//获取安装区域说明

    @POST(Constants.PATH_CREATE_ORDER)
    @FormUrlEncoded
    Call<String> createOrder(@Field("user_token") String user_token,
            @Field("goods_id") String goods_id,
            @Field("goods_num") int goods_num,
            @Field("is_install") int is_install,
            @Field("province") String province,
            @Field("city") String city,
            @Field("county") String county,
            @Field("address") String address,
            @Field("consignee") String consignee,
            @Field("phone") String phone,
            @Field("install_fee") String install_fee,
            @Field("added_fee") String added_fee,
            @Field("discount_amount") String discount_amount,
            @Field("pay_type") int pay_type,
            @Field("remark") String remark);

    @GET(Constants.PATH_GET_KEFUDH)
    Call<String> getKefudianhua();//获取客服电话

    @GET(Constants.PATH_GET_ZENGZHIFUWW)
    Call<String> getZengzhifuwu();//PATH_GET_ZENGZHIFUWW

    @POST(Constants.PATH_HAS_MESSAGE)
    @FormUrlEncoded
    Call<String> hasUnReadMessage(@Field("user_token")String userToken);

    @POST(Constants.PATH_LUNXUN_LOCK_OPEN)
    @FormUrlEncoded
    Call<String> lunxunLock(@Field("user_token")String userToken,@Field("lock_id")String lock_id);
}
